//生成任意区间的随机值
function rand(min, max) {
    return Math.round(Math.random() * (max - min) + min);
}

$("h3>a").mouseover(function() {
    $(this).css({
        color: "skyblue",
        borderBottom: "1px solid skyblue",
    })
}).mouseout(function() {
    $(this).css({
        color: "",
        borderBottom: ""
    })
})

let oInputs = document.querySelectorAll("input");
let oP = document.querySelectorAll("p");
// 手机号
oInputs[0].onblur = function() {
        let regPhone = /^1(5|3|8|7|9)\d{9}$/;
        if (this.value == "") {
            oP[0].innerHTML = "手机号不能为空";
            flagName = false;
        } else if (!regPhone.test(this.value)) {
            oP[0].innerHTML = "请输入正确的手机格式";
            flagName = false;
        } else {
            oP[0].innerHTML = "";
            flagName = true;
        }
    }
    // 密码
let _regNum = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$/;
oInputs[1].onblur = function() {
    if (this.value == "") {
        oP[1].innerHTML = "密码不能为空";
        flagName = false;
    } else if (!_regNum.test(this.value)) {
        oP[1].innerHTML = "密码格式不正确";
        flagName = false;
    } else {
        oP[1].innerHTML = "";
        flagName = true;
    }
}